package com.example.demo.mp.controller;


import com.example.demo.mp.entity.entity.UserGroupUserEntity;
import com.example.demo.mp.service.UserGroupUserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 执行器实例 前端控制器
 * </p>
 *
 * @author JXY
 * @since 2022-03-24
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Resource
    UserGroupUserService userGroupUserService;

    @RequestMapping("/insertUser")
    public void insertUser() {
        UserGroupUserEntity user = new UserGroupUserEntity();
        user.setUserSymbol("u1");
        user.setUserGroupSymbol("ug1");
        user.setProperty("{}");
        user.setMerchantId(1L);
        userGroupUserService.save(user);
    }

    @RequestMapping("/del/{id}")
    public void del(@PathVariable Long id) {
        userGroupUserService.removeById(id);
    }

}
